<template>
  <div class="profile-settings">
    <!-- 帮助按钮 -->
    <div class="help-button">
      帮助与反馈
    </div>

    <!-- 上传提示 -->
    <div class="upload-tip">
      上传真实头像，才能获得曝光推荐
      <span class="arrow">»</span>
    </div>

    <!-- 个人资料 -->
    <div class="profile-section">
      <div class="avatar-upload" @click="openPhotoModal()">
        <div class="avatar-placeholder">
          上传头像
        </div>
      </div>

      <div class="profile-info">
        <div class="name-section">
          <h2>做个平淡的自己</h2>
          <span class="verify-badge">
            <span class="check-icon">✓</span>
            未实名
          </span>
        </div>

        <div class="progress-section">
          <div class="progress-bar">
            <div class="progress-fill" style="width: 31%">31%</div>
          </div>
          <button class="complete-button" @click="edit">
            立即完善
            <span class="arrow">›</span>
          </button>
        </div>
      </div>
    </div>

    <!-- 统计数据 -->
    <div class="stats-section">
      <div class="stat-item">
        <div class="stat-number">7</div>
        <div class="stat-label">我看过</div>
      </div>
      <div class="stat-item">
        <div class="stat-number">0</div>
        <div class="stat-label">关注我</div>
      </div>
      <div class="stat-item">
        <div class="stat-number">0</div>
        <div class="stat-label">赞过我</div>
      </div>
      <div class="stat-item">
        <div class="stat-number">0</div>
        <div class="stat-label">评论我</div>
      </div>
    </div>

    <!-- 推广横幅 -->
    <div class="promo-banner">
      <div class="avatar-group">
        <img src="/placeholder.svg?height=30&width=30" alt="User 1" />
        <img src="/placeholder.svg?height=30&width=30" alt="User 2" />
      </div>
      <div class="promo-text">精准大量曝光，大幅提升脱单率</div>
      <div class="promo-arrow">›</div>
    </div>

    <!-- 功能按钮区 -->
    <div class="feature-grid">
      <div class="feature-item">
        <div class="feature-icon purple">
          <span>✏️</span>
        </div>
        <div class="feature-label">我的动态</div>
      </div>
      <div class="feature-item">
        <div class="feature-icon orange">
          <span>💭</span>
        </div>
        <div class="feature-label">我的观点</div>
      </div>
      <div class="feature-item">
        <div class="feature-icon pink">
          <span>💝</span>
        </div>
        <div class="feature-label">心灵视界</div>
      </div>
      <div class="feature-item">
        <div class="feature-icon blue">
          <span>📝</span>
        </div>
        <div class="feature-label">我的认证</div>
        <span class="notification-dot"></span>
      </div>
    </div>

    <!-- 会员选项 -->
    <div class="membership-section">
      <div class="membership-item">
        <div class="discount-tag">限时8折</div>
        <div class="membership-icon crown">👑</div>
        <div class="membership-info">
          <div class="membership-name">珍心会员</div>
          <div class="membership-perks">7项特权</div>
        </div>
      </div>

      <div class="membership-item">
        <div class="discount-tag">限时8折</div>
        <div class="membership-icon diamond">💎</div>
        <div class="membership-info">
          <div class="membership-name">超级会员</div>
          <div class="membership-perks">14项特权</div>
        </div>
      </div>

      <div class="membership-item">
        <div class="membership-icon star">⭐</div>
        <div class="membership-info">
          <div class="membership-name">星级特权</div>
          <div class="membership-perks">解锁关注</div>
        </div>
      </div>

      <div class="membership-item">
        <div class="membership-icon coin">🪙</div>
        <div class="membership-info">
          <div class="membership-name">珍爱币</div>
          <div class="membership-perks">购各类服务</div>
        </div>
      </div>
    </div>

    <!-- 超级推荐 -->
    <div class="super-recommend">
      <div class="recommend-icon">🔖</div>
      <div class="recommend-info">
        <div class="recommend-title">超级推荐</div>
        <div class="recommend-subtitle">配对利器</div>
      </div>
    </div>

    <!-- 底部提示 -->
    <div class="bottom-tip">
      <div class="key-icon">🔑</div>
      <span>使用爱情钥匙可解锁消息</span>
    </div>

    <!-- 设置按钮 -->
    <div class="settings-button" @click="goToSettings">
      <div class="settings-content">
        <span class="settings-icon">⚙️</span>
        <span class="settings-text">设置</span>
      </div>
    </div>

    <!-- 底部导航栏 -->
    <FooterBar :nav-items="customNavItems" :unread-count="27" :has-new-notification="true" />

    <div class="nav-bar">
      <div class="help-button" @click="showHelp">
        <span class="help-icon">?</span>
      </div>
      <div class="title">我的</div>
      <div class="settings-button" @click="goToSettings">
        <span class="settings-icon">⚙️</span>
      </div>
    </div>

    <!-- 其他内容 -->
    <PhotoUploadModal 
      :visible="showPhotoModal" 
      @close="showPhotoModal = false"
      @select-photo="handleSelectPhoto"
      @take-photo="handleTakePhoto"
    />
  </div>
</template>
<script setup>
import { ref } from 'vue'

import FooterBar from '@/components/footerBar/FooterBar.vue';
import PhotoUploadModal from '@/components/PhotoUploadModal.vue'
import { useRouter } from 'vue-router'
import request from '@/utils/request'
import { useUserStore } from '@/stores/user'

const router = useRouter()
const showPhotoModal = ref(false)

const handleSelectPhoto = () => {
  // 处理从相册选择照片的逻辑
  console.log('选择照片')
  showPhotoModal.value = false
}
const edit=()=>{
  router.push("content")

}

const handleTakePhoto = () => {
  // 处理拍照的逻辑
  console.log('拍照')
  showPhotoModal.value = false
}

// 打开模态框的方法
const openPhotoModal = () => {
  showPhotoModal.value = true
}
const customNavItems = ref([
  {
    path: '/recommend',
    name: '推荐',
    icon: '🔍',
    badgeType: null
  },
  {
    path: '/meet',
    name: '见面',
    icon: '👥',
    forceHighlight: true // 强制高亮当前页
  },]);

// 跳转到设置页面
const goToSettings = () => {
  router.push('/settings')
}
</script>

<style scoped>
.profile-settings {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  max-width: 414px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(to bottom right, #e9d5ff, #fff1f2);
  position: relative;
  padding-bottom: 60px;
}

/* 状态栏样式 */
.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  color: #000;
  font-weight: bold;
}

.status-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.battery {
  background-color: #ffeb3b;
  padding: 2px 4px;
  border-radius: 10px;
  font-size: 12px;
}

/* 帮助按钮样式 */
.help-button {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 14px;
  color: #666;
}

/* 上传提示样式 */
.upload-tip {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  margin: 10px auto;
  width: 85%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

/* 个人资料样式 */
.profile-section {
  padding: 20px 16px;
  display: flex;
  gap: 16px;
}

.avatar-upload {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
}

.profile-info {
  flex: 1;
}

.name-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.name-section h2 {
  margin: 0;
  font-size: 18px;
}

.verify-badge {
  background-color: #f0f0f0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #666;
}

.progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 16px;
  background-color: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #818cf8;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-button {
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 统计数据样式 */
.stats-section {
  display: flex;
  justify-content: space-around;
  padding: 20px 0;
  border-bottom: 8px solid #f5f5f5;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #666;
}

/* 推广横幅样式 */
.promo-banner {
  margin: 16px;
  background-color: #fff5e0;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.avatar-group {
  display: flex;
  margin-right: 12px;
}

.avatar-group img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -10px;
}

.promo-text {
  flex: 1;
  font-size: 14px;
  font-weight: bold;
}

/* 功能按钮区样式 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 16px;
  background-color: white;
  border-radius: 12px;
  margin: 16px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.feature-icon.purple {
  background-color: #e0e7ff;
}

.feature-icon.orange {
  background-color: #fff7ed;
}

.feature-icon.pink {
  background-color: #fce7f3;
}

.feature-icon.blue {
  background-color: #e0f2fe;
}

.feature-label {
  font-size: 12px;
  color: #666;
}

/* 会员选项样式 */
.membership-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  background-color: white;
  border-radius: 12px;
  margin: 16px;
}

.membership-item {
  position: relative;
  text-align: center;
}

.discount-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f87171;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
}

.membership-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.membership-name {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #666;
}

.membership-perks {
  font-size: 12px;
  color: #666;
}

/* 超级推荐样式 */
.super-recommend {
  margin: 16px;
  padding: 16px;
  background-color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recommend-icon {
  font-size: 24px;
}

.recommend-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}

.recommend-subtitle {
  font-size: 12px;
  color: #666;
}

/* 底部提示样式 */
.bottom-tip {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(249, 168, 212, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 底部导航样式 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background-color: white;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  max-width: 414px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #666;
  position: relative;
}

.nav-item.active {
  color: #818cf8;
}

.nav-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.unlock-button {
  position: absolute;
  top: -16px;
  background-color: #f87171;
  color: white;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 10px;
}

.notification-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f87171;
}

.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  background-color: white;
  padding: 8px 16px;
  border-top: 1px solid #f0f0f0;
  max-width: 414px;
  margin: 0 auto;
}

.help-icon {
  font-size: 24px;
  cursor: pointer;
}

.title {
  font-size: 18px;
  font-weight: bold;
}

.settings-button {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  padding: 12px 24px;
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 100;
}

.settings-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-icon {
  font-size: 20px;
}

.settings-text {
  font-size: 16px;
  color: #333;
}
</style>